﻿@model Clirelmgt.Models.NewObject
@{
    ViewBag.Title = "Create New Object";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

<script type="text/javascript">
    function showTables()
    {
        document.getElementById('divTable').style.display = '';
        if (document.getElementById('ObjectType').value == 'TABLE') {
            document.getElementById('divTable').style.display = 'none';
        }
    }
</script>

<div class="dashboard-wrapper">
    <div class="left-sidebar">
        <div class="row-fluid">
            <div class="span12">
                <div class="widget">
                    <div class="widget-header">
                        <div class="title">
                            Create new object
                        </div>
                    </div>
                    <div class="widget-body">
                        <form class="form-horizontal no-margin" method="post">
                            <div class="control-group">
                                <label class="control-label" for="name">
                                    Module
                                </label>
                                <div class="controls controls-row">
                                    <select id="Module" name="Module">
                                        @foreach (KeyValuePair<int, string> item in Model.Modules)
                                        {
                                            <option value="@item.Key">@item.Value</option>    
                                        }
                                    </select>
                                    <span class="field-validation-valid" data-valmsg-for="Module" data-valmsg-replace="true"></span>
                                </div>
                            </div>
                            
                            <div class="control-group">
                                <label class="control-label" for="name">
                                    Object Type
                                </label>
                                <div class="controls controls-row">
                                    <select id="ObjectType" name="ObjectType" onchange="showTables();">
                                        <option value="TABLE">TABLE</option>
                                        <option value="LIST">LIST</option>
                                        <option value="CARD">CARD</option>
                                        <option value="PROCESS">PROCESS</option>
                                    </select>
                                    <span class="field-validation-valid" data-valmsg-for="ObjectType" data-valmsg-replace="true"></span>
                                </div>
                            </div>

                            <div class="control-group" id="divTable" style="display:none;">
                                <label class="control-label" for="name">
                                    Link Table
                                </label>
                                <div class="controls controls-row">
                                    <select id="LinkTable" name="LinkTable">
                                        @foreach (string item in Model.Tables)
                                        {
                                            <option value="@item">@item</option>    
                                        }
                                    </select>
                                    <span class="field-validation-valid" data-valmsg-for="ObjectType" data-valmsg-replace="true"></span>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="name">
                                    Name
                                </label>
                                <div class="controls controls-row">
                                    <input class="span5" type="text" id="Name" name="Name" data-val="true" data-val-required="Required!" />
                                    <span class="field-validation-valid" style="color:red; font-size:11px; margin-left:5px;" data-valmsg-for="Name" data-valmsg-replace="true"></span>
                                </div>
                            </div>
                            <div class="form-actions no-margin">
                                <button type="submit" class="btn btn-info pull-right">
                                    Create
                                </button>
                                <div class="clearfix">
                                </div>
                            </div>

                        </form>

                    </div>
                </div>
            </div>

        </div>
    </div>

    <div class="right-sidebar">


        <div class="wrapper">
            <table class="table table-condensed table-striped table-bordered table-hover no-margin">
                <thead>
                    <tr>
                        <th style="width: 10%">
                            <input type="checkbox" class="no-margin" />
                        </th>
                        <th style="width: 70%">Name
                        </th>
                        <th style="width: 20%">Status
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>
                            <input type="checkbox" class="no-margin" />
                        </td>
                        <td>
                            <span class="name">Mahendra Singh Dhoni
                            </span>
                        </td>
                        <td>
                            <span class="label label label-info">New
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="checkbox" class="no-margin" />
                        </td>
                        <td>
                            <span class="name">Michel Clark
                            </span>
                        </td>
                        <td>
                            <span class="label label label-success">New
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="checkbox" class="no-margin" />
                        </td>
                        <td>
                            <span class="name">Rahul Dravid
                            </span>
                        </td>
                        <td>
                            <span class="label label label-important">New
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="checkbox" class="no-margin" />
                        </td>
                        <td>
                            <span class="name">Anthony Michell
                            </span>
                        </td>
                        <td>
                            <span class="label label label-info">New
                            </span>
                        </td>

                    </tr>
                    <tr>
                        <td>
                            <input type="checkbox" class="no-margin" />
                        </td>
                        <td>
                            <span class="name">Srinu Baswa
                            </span>
                        </td>
                        <td>
                            <span class="label label label-success">New
                            </span>
                        </td>

                    </tr>
                </tbody>
            </table>
        </div>

        <hr class="hr-stylish-1">

        <div class="wrapper">
            <div class="btn-toolbar no-margin">
                <div class="btn-group">
                    <a href="#" class="btn btn-success">
                        <i class="icon-white icon-headphones"></i>
                    </a>
                    <a href="#" class="btn btn-warning">
                        <i class="icon-white icon-thumbs-down"></i>
                    </a>
                    <a href="#" class="btn btn-warning2">
                        <i class="icon-white icon-signal"></i>
                    </a>
                    <a href="#" class="btn btn-info">
                        <i class="icon-white icon-share-alt"></i>
                    </a>
                </div>
                <div class="btn-group">
                    <a href="#" class="btn btn-inverse">
                        <i class="icon-white icon-trash"></i>
                    </a>
                </div>
            </div>
        </div>

    </div>
</div>
